package com.turing.post.datatranfer.util;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
/**
 * 实体卡库存表
 * @author ZXL
 *
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "BANKACCOUNT")
@IdClass(EntityCard.class)
public class EntityCard implements Serializable{
	
	public final static String BATCHNO_ADD = "961850";
	/**
	 * 制卡批次号
	 */
	private String batchNo;
	/**
	 * 卡顺序号
	 */
	private String cardSeqNo;
	/**
	 * 卡号
	 */
	private String cardNo;
	/**
	 * 所属机构
	 */
	private String branchNo;
	/**
	 * 卡密文密码
	 */
	private String cardPwd;
	
	@Column(name = "BATCHNO", nullable = false)
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	@Id
	@Column(name = "CARDSEQNO", nullable = false)
	public String getCardSeqNo() {
		return cardSeqNo;
	}
	public void setCardSeqNo(String cardSeqNo) {
		this.cardSeqNo = cardSeqNo;
	}
	@Id
	@Column(name = "CARDNO", nullable = false)
	public String getCardNo() {
		return cardNo;
	}
	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}
	@Column(name = "BRANCHNO", nullable = false)
	public String getBranchNo() {
		return branchNo;
	}
	public void setBranchNo(String branchNo) {
		this.branchNo = branchNo;
	}
	@Column(name = "CARDPWD", nullable = false)
	public String getCardPwd() {
		return cardPwd;
	}
	public void setCardPwd(String cardPwd) {
		this.cardPwd = cardPwd;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((this.getCardNo() == null) ? 0 : this.getCardNo().hashCode());
		result = prime * result
				+ ((this.getCardSeqNo() == null) ? 0 : this.getCardSeqNo().hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		EntityCard other = (EntityCard) obj;
		if (this.getCardNo() == null) {
			if (other.getCardNo() != null)
				return false;
		} else if (!this.getCardNo().equals(other.getCardNo()))
			return false;
		if (this.getCardSeqNo() == null) {
			if (other.getCardSeqNo() != null)
				return false;
		} else if (!this.getCardSeqNo().equals(other.getCardSeqNo()))
			return false;
		return true;
	}
	
	
	
}
